import type { IQuery, TableConfig } from '@/api/config/types';
import type { SystemDept } from '@/api/modules/system/dept/types';
//查询参数接口
interface deptQuery {
  deptName: '';
  leader: '';
  phone: '';
  status: '0' | '1';
}

let queryObj: IQuery<deptQuery> = {
  pageNum: 1,
  pageSize: 10,
  total: 0,
  deptName: '',
  leader: '',
  phone: '',
  status: '0',
};

const resetQuery = () => {
  deptTable.value.query = {
    ...queryObj,
  };
};

export const deptTable = ref<TableConfig<SystemDept>>({
  //作用：勾选的唯一标识
  rowKey: 'deptId',
  data: [],
  loading: false,
  moduleName: 'dept',
  viewMode: 'table',
  keys: [],
  query: queryObj,
  contextmenu: [],
  reset: resetQuery,
});
